import request from "@/utils/request.js";
//新增地址
export const addNewAddress=(data)=>request.post("/api/user/addressBook",data)
//查询登录用户的所有地址
export const getAddressList=()=>request.get("/api/user/addressBook/list")
//查询默认地址
export const getDefaultAddress=()=>request.get("/api/user/addressBook/default")
//根据id删除地址
export const deleteAddress=(id)=>request.delete("/api/user/addressBook/",{params:{id}})
//修改地址
export const updateAddress=(data)=>request.put("/api/user/addressBook",data)
//根据id查询地址
export const getAddressById=(id)=>request.get(`/api/user/addressBook/${id}`)
// 设置默认地址
export const setDefaultAddress = (id) => request.put(`/api/user/addressBook/default`, { id })
